<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>交费套餐</title>
	<link rel="stylesheet" href="css/common2.css">
	<link rel="stylesheet" href="css/urlty.css">
	<style>
		.search_img {
			position: absolute;
			margin-top: -35px;
			right: 3%;
		}
        .td-width{
            width: 150px;
        }
	</style>

</head>


<body>
	<div id="vue-root" style="border: 1px solid rgba(200,200,200,0.01);">

		<div class="search_box" style="margin-top: 50px;">
			<div class="add">
				<a href="mealSettings_item.html" style="color: white">添加套餐</a>
			</div>
			<div class="refresh" onclick="location.reload()">刷新</div>
		</div>
		<br>

		<div class="table" style="margin-top: -30px;">
			<table class="table_top">
				<thead>
					<tr>
						<!-- <th>
							<input type="checkbox" class="check-box" v-model="all">
						</th> -->
						<th>序号</th>
                        <th>金额</th>
						<th>时间</th>
						<th>编辑/删除</th>
					</tr>
				</thead>
				<tbody id="list" v-if="mealList.length">
					<tr v-for="(meal,index) in mealList" :key="meal.id">
						<!-- <td>
							<input type="checkbox" class="check-box" v-model="school.checked">
						</td> -->
						<td><span v-text="index+1"></span></td>
						<td v-text="meal.packageAmount"></td>
						<td v-text="meal.mealName+'年'"></td>
						<td class="td-width">
							<div class="option">
								<div class="edit-icon option-icon" @click="edit(meal.id)"
									style="position: absolute; left: 20%; top: 30%;">
									<img class="img" src="../image/edit.png" height="20" width="20"
										onmouseover="this.src='image/edit_light.png'"
										onmouseout="this.src='image/edit.png'" />
								</div>
								<div class="delete-icon option-icon" @click="del([meal.id],true)"
									style="right: 20%; top:30%;position: absolute;">
									<img class="img" src="../image/delete.png" height="20" width="20"
										onmouseover="this.src='image/delete_light.png'"
										onmouseout="this.src='image/delete.png'" />
								</div>
							</div>
						</td>
					</tr>
				</tbody>
				<tbody id="list" v-else>
					<tr><td style="border: none;">暂无套餐</td> </tr> 
				</tbody>
			</table>
		</div>
		<!-- <div class="delete" @click="batchDelete" v-if="total>1">批量删除</div>
		<ul class="pagination" v-if="pages>1">
			<li>
				<a v-if="pageNum!=1" @click="pageNum=1">«</a>
				<a class="pages-jump" v-if="pageNum!=1" @click="pageNum--">‹</a>
				<a v-text="pageNum"></a>
				<a class="pages-jump" v-if="pageNum!=pages" @click="pageNum++">›</a>
				<a v-if="pageNum!=pages" @click="pageNum=pages">»</a>
			</li>
			<li>
				<a v-text="pages"></a> -->
				<!--页面总数-->
			<!-- </li>
		</ul> -->
		<!-- <div style="float: right;margin-bottom: 20px;">
			总共{{total}}条记录
			<select class="ui-select init" style="height:32px" v-model="pageSize"> -->
				<!--style="margin-top: 14px;"-->
				<!-- <option :value="10">每页10条</option>
				<option :value="30">每页30条</option>
				<option :value="100">每页100条</option>
			</select> -->
		</div>
	</div>

	<script src="/scriptZIP/qs.min.js"></script>
	<script src="/scriptZIP/vue.min.js"></script>
	<script src="/scriptZIP/axios.min.js"></script>
	<script src="/scriptZIP/dayjs.min.js"></script>
	<script src="/js/common.js"></script>
	<script src="/js/list.js"></script>
	<script>
		var app = new Vue(merge({
			data: {
				urls: {
					// list: '/pc/school/list',
					del: '/pc/menu/del'
				},
				mealList: [],
				search: {
					active: params().active
				},
			},
			created: function () {
				this.getMeal()
			},
			methods: {
                // 获取套餐
                getMeal:function(){
                    axios.post('/pc/menu/getMenu').then(function (res) {
                        this.mealList = res.data.setMenus;
                    }.bind(this));
                },
				edit: function (id) {
					location.href = "mealSettings_item.html?id=" + id;
				},
				// createTime: function (school) {
				// 	return dayjs(school.id / 4096 + 1.56E12).format('YYYY-MM-DD HH:mm:ss');
				// }
			}
		}));
	</script>
</body>

</html>